<?php

namespace Wilead\IArtistBundle\Entity;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Table(
 *      indexes={
 *          @ORM\Index(name="user_id", columns={"userId", "jobId"})
 *      },
 *      uniqueConstraints={
 *          @ORM\UniqueConstraint(name="unique_column", columns={"userId", "jobId"})
 *      }
 * )
 * @ORM\Entity(repositoryClass="Wilead\IArtistBundle\Repository\JobCollectionRepository")
 */
class JobCollection {

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="User")
     * @ORM\JoinColumn(name="userId", referencedColumnName="id", nullable=false, onDelete="CASCADE")
     * */
    private $Users;

    /**
     * @ORM\ManyToOne(targetEntity="Job")
     * @ORM\JoinColumn(name="jobId", referencedColumnName="id", nullable=false, onDelete="CASCADE")
     * */
    private $Jobs;

    /**
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(type="datetime")
     */
    private $created;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     * @return JobCollection
     */
    public function setCreated($created) {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime 
     */
    public function getCreated() {
        return $this->created;
    }

    /**
     * Set Users
     *
     * @param \Wilead\IArtistBundle\Entity\User $users
     * @return JobCollection
     */
    public function setUsers(\Wilead\IArtistBundle\Entity\User $users) {
        $this->Users = $users;

        return $this;
    }

    /**
     * Get Users
     *
     * @return \Wilead\IArtistBundle\Entity\User 
     */
    public function getUsers() {
        return $this->Users;
    }

    /**
     * Set Jobs
     *
     * @param \Wilead\IArtistBundle\Entity\Job $jobs
     * @return JobCollection
     */
    public function setJobs(\Wilead\IArtistBundle\Entity\Job $jobs) {
        $this->Jobs = $jobs;

        return $this;
    }

    /**
     * Get Jobs
     *
     * @return \Wilead\IArtistBundle\Entity\Job 
     */
    public function getJobs() {
        return $this->Jobs;
    }

}